package com.pig4cloud.pigx.wallet.api.v1.controller;

import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.customize.api.annotation.OpenApi;
import com.pig4cloud.pigx.user.enums.UserApiKeyEnum;
import com.pig4cloud.pigx.wallet.api.v1.service.CapitalAccountServiceV1;
import com.pig4cloud.pigx.wallet.websocket.CapitalAccountVo;
import io.swagger.annotations.Api;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 开放API - 资金账户 - v1版本
 *
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/wallet/capital/account" )
@Api(value = "api_capital_account_v1", tags = "开放api-资金账户")
public class CapitalAccountControllerV1 {

	private final CapitalAccountServiceV1 service;

	/**
	 * 获取资金账户余额
	 * @return r
	 */
	@OpenApi(version = "1",permission = UserApiKeyEnum.Permission.READ,needSignature = true)
	@GetMapping("/balance")
	public R<CapitalAccountVo> getBalance() {
		return service.getBalance();
	}
}
